Obscure Test ^^^^^ **Definition:** * It is difficult to understand the test at a glance. Automated tests should serve at least two purposes. First, they should act as documentation of how the system under test (SUT) should behave; we call this Tests as Documentation (see Goals of Test Automation on page X). Second, they should be a self-verifying executable specification. These two goals are often contradictory because the level of detailed needed for tests to be executable may make the test so verbose as to be difficult to understand. **Also Known As:** * Long Test, Complex Test, Verbose Test **Code Example:** .. code-block:: ruby context 'the element does not exist' do before do contents = %( ) xml_doc = Nokogiri::XML(contents) episode_element = xml_doc.xpath('//item').first @rss_feed_episode = RSSFeedEpisode.new(episode_element) end it 'returns an empty string' do expect(@rss_feed_episode.content('title')).to eq('') end end **References:** .. admonition:: Quality attributes * :octicon:`file-code;1em` - Code Example * :octicon:`comment-discussion;1em` - Cause and Effect * :octicon:`graph;1em` - Frequency * :octicon:`sync;1em` - Refactoring * `An analysis of information needs to detect test smells `_ :octicon:`comment-discussion;1em` * `Detecting redundant unit tests for AspectJ programs `_ :octicon:`comment-discussion;1em` * `Did You Remember To Test Your Tokens? `_ :octicon:`comment-discussion;1em` * `Enhancing developers’ awareness on test suites’ quality with test smell summaries `_ * `Inspecting Automated Test Code: A Preliminary Study `_ :octicon:`graph;1em` * `Obscure Test `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`sync;1em` * `On the Maintenance of System User Interactive Tests `_ :octicon:`comment-discussion;1em` :octicon:`graph;1em` :octicon:`sync;1em` * `Rails Testing Antipatterns `_ :octicon:`file-code;1em` :octicon:`sync;1em` * `Smells in System User Interactive Tests `_ :octicon:`comment-discussion;1em` :octicon:`graph;1em` :octicon:`sync;1em` * `Test code quality and its relation to issue handling performance `_ :octicon:`comment-discussion;1em` * `Test smell: Obscure Test `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`sync;1em` * `xUnit test patterns: Refactoring test code `_ :octicon:`comment-discussion;1em` :octicon:`sync;1em` * `xUnit test patterns: Refactoring test code `_ :octicon:`comment-discussion;1em` :octicon:`sync;1em`